import { createStore } from "vuex";
import auth from "./auth";
const store = createStore({
  modules: {
    auth
  },
  state() {
    // 定义状态
    return {
      count: 0,
      msg: '好好回'
    }
  },
  mutations: {
    // 定义mutations
    add(state) {
      // this.count = this.state.count++;
      state.count++;
    },
    sub(state) {
      // this.count = this.state.count--
      state.count--
    }
  },
  actions: {
    // 定义actions
    
  },
  // 来改变值
  getters: {
    // 定义getters
    doubleCount(state) {
      return state.count * 2
    }
  }
})
export default store;